package com.example.demo.modules.customDefine.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.modules.customDefine.entity.Supplier;
import com.example.demo.modules.customDefine.mapper.SupplierMapper;
import com.example.demo.modules.customDefine.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements SupplierService {

    @Autowired
    private SupplierMapper supplierMapper;

    //查询所有
    @Override
    public List<Supplier> listAll() {
        List<Supplier> suppliers = this.list();
        return suppliers;
    }

    //条件查询
        @Override
    public Supplier listOne(Long id) {
        Supplier supplier = this.getById(id);
        return supplier;
    }

    //保存
        @Override
    public int insert(Supplier supplier){
        return supplierMapper.insert(supplier);

    }

}
